#pragma once


// CWEdit
class CWCheckbox;

class CWEdit : public CEdit
{
	DECLARE_DYNAMIC(CWEdit)

public:
	CWEdit(CWEdit* pParent, CWEdit* pPrev, CWEdit* pNext, int depth);
	virtual ~CWEdit();

	void setTextColor(COLORREF color);
	void AutoSize(CString& strWndText);
	void MoveControl(CWnd* pWnd, int distanceX);
	void UpdateLabel();
protected:
	DECLARE_MESSAGE_MAP()
public:
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnSetFocus(CWnd* pOldWnd);
	afx_msg void OnKillFocus(CWnd* pNewWnd);

protected:
	CWEdit* m_pParent;
	CWEdit* m_pPrev;
	CWEdit* m_pNext;

	CWCheckbox* m_pCheckBox;
	CStatic* m_pLabel;
	CFont* m_pFont;
	COLORREF m_textColor;

	int m_depth;
public:
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg HBRUSH CtlColor(CDC* /*pDC*/, UINT /*nCtlColor*/);
	afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
};


